fix: Remove pyproject.toml from .genignore#99
Conversation
Update related metadata in `.speakeasy/gen.yaml` so that the `pyproject.toml` can be autogenerated. This fixes a number of issues that we have had with speakeasy generation (basically there was no way for the generation to update dependencies, add scripts, etc).
| outputModelSuffix: output | ||
| packageManager: poetry | ||
| packageName: glean | ||
| packageName: glean-api-client |
There was a problem hiding this comment.
@rwjblue-glean This looks strange. Isn't the package name supposed to be glean? We publish glean-api-client but the package users import from is glean
There was a problem hiding this comment.
Hmm, no, I think this is correct?
If you notice the [tool.poetry] section in pyproject.toml is unchanged:
packages = [
{ include = "glean", from = "src" }
]
AFAICT this is the correct way to do PEP 420 namespaced packages.
There was a problem hiding this comment.
tldr; the import path is governed by the file layout in the sdist/wheel (which we haven't changed with this config change).
Landing this change, then running speakeasy run doesn't change anything about the file system layout (happy to push up a branch for you to review just to be safe).
Originally (when we first created the api clients), Speakeasy didn't support PEP 420 namespaced packages but they landed that support a few months back. In this docs they have two settings:
moduleName-- this is the expected import path for users (what is shown in the code samples, docs, etc)packageName-- this is what is actually published to pypi
We had a work around (added in #23) that ran speakeasy run then munged a bunch of stuff in order to have the PEP 420 namespacing, but then when Speakeasy added support I updated (in #43) to avoid a really gnarly workaround that we had previously (basically setting the new moduleName field).
There was a problem hiding this comment.
k. As long as the imports still work then ![]()
Update related metadata in
.speakeasy/gen.yamlso that thepyproject.tomlcan be autogenerated.This fixes a number of issues that we have had with speakeasy generation (basically there was no way for the generation to update dependencies, add scripts, etc).